import axios from '../../index'

//获取订单的数据流量
export const getOrderData = (dateLimit, type = 0) => {
    return axios({
        method: 'get',
        url: '/api/admin/store/order/status/num',
        params: {
            dateLimit,
            type
        }
    })
}

//获取订单详情信息的
// status=all&dateLimit=&orderNo=&page=1&limit=10&type=0&
export const getOrderdetail = (status, dateLimit, orderNo, page, limit, type = 0) => {
    return axios({
        method: 'get',
        url: '/api/admin/store/order/list',
        params: {
            status,
            dateLimit,
            orderNo,
            page,
            limit,
            type
        }
    })
}



//发送快递需要的接口

export const setSend = (deliveryName, deliveryTel, expressCode, expressName, expressNumber,
    expressRecordType, expressTempId, orderNo, toAddr, toName, toTel, type) => {
    console.log(orderNo);
    return axios({
        method: 'post',
        url: '/api/admin/store/order/send',
        data: {
            "deliveryName": deliveryName,
            "deliveryTel": deliveryTel,
            "expressCode": expressCode,
            "expressName": expressName,
            "expressNumber": expressNumber,
            "expressRecordType": expressRecordType,
            "expressTempId": expressTempId,

            "orderNo": orderNo,
            "toAddr": toAddr,
            "toName": toName,
            "toTel": toTel,
            "type": type
        }
    })
}

//获取全部的快递公司
export const getcourierCompany = (type) => {
    return axios({
        method: 'get',
        url: '/api/admin/express/all',
        params: {
            type
        }
    })
}

//获取发货人的信息

export const getshipperInformation = () => {
    return axios({
        method: 'get',
        url: '/api/admin/store/order/sheet/info',
    })
}

//获取发货的详情信息
export const getDeliveryInformation = (orderNo) => {
    return axios({
        method: 'get',
        url: '/api/admin/store/order/info?',
        params: {
            orderNo
        }
    })
}